<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=5.0" charset="UTF-8">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<meta name="format-detection" content="telephone=no">
		
		<!--<link type="text/css" rel="stylesheet" href="../css/model/bootstrap.css"  />-->
		<link type="text/css" rel="stylesheet" href="../css/model/swiper.css"  />
		<link type="text/css" rel="stylesheet" href="../css/layui.css" />
		<link type="text/css" rel="stylesheet" href="../css/jieshu_top.css" />
		<link type="text/css" rel="stylesheet" href="../css/new.css" />
		
		<script type="text/javascript" src='../js/model/jquery-2.1.4.min.js'></script>
		<script type="text/javascript" src="../js/model/bootstrap.js"></script>
		<script type="text/javascript" src="../js/model/swiper.js"></script>
		<script type="text/javascript" src="../js/model/reset_font.js"></script>
		<script type="text/javascript" src="../js/layer/layer.js"></script>
		
		<script type="text/javascript" src="../js/new.js"></script>
			
		<title>优当借书</title>
		<script type="text/javascript">
			$(function(){
				 $("body").on("click",".item",function(){
        			if($(document).scrollTop() != 0) {
        				var scrollY=$(document).scrollTop();
		            	sessionStorage.setItem("aim", scrollY);
		               	}
		            });
			})
       

        window.onload = function() {　
       		var _offset = sessionStorage.getItem("aim");　　
            $(document).scrollTop(_offset)
           
        };
		</script>
	</head>
	<body>
		<!--头部-->
		<div class="top">
			<a href="wyjs.html" class="goback">
				<img src="../images/wyjs/goback.png"  />
			</a>
			<div class="searchbar">
				<a href="search.html">
					<img src="../images/wyjs/search.png" class="searchpic" />
					<input type="text" placeholder="搜索您想要的书籍" class="search_input" readonly="readonly" />
				</a>
			</div>
			<img src="../images/wyjs/menu.png"  class="menu"/>
		</div>
		<!--头部 结束-->
		<!--主体 开始-->
		<div class="main">
			<!--一级分类-->
			<div class="navs chosen-container" id="regUseBtn">
				<div class="chosen-swiper">
					<a href="#" class="nav1 Btnbutton active">
						<p>
						  <img src="../images/wyjs/new.png"	 />
						  <span>优当上新</span>
						</p>
					</a>
					<a href="#" class="nav2 Btnbutton">
						<p>
							<img src="../images/wyjs/star.png"	 />
						  	<span>优当推荐</span>
						</p>
					</a>
					<a href="#" class="nav3 Btnbutton">
						<p>
							<img src="../images/wyjs/hot.png"	 />
						  	<span>热门借阅</span>

						</p>
					</a>
					
					<div class="clear"></div>
				</div>
			</div>
			<!--一级分类 结束-->
			<div class="swiper-container" id="registerCont">
				<div class="swiper-wrapper">
					<!--swiper slider begin-->
					<div class="swiper-slide" id="slider1">
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<img src="../images/icons/new.png" class="i_pic" />
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">小王子流浪记</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">0</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
						
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<img src="../images/icons/hot.png" class="i_pic" />
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">小王子流浪记</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">1</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<img src="../images/icons/tui.png" class="i_pic" />
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">小王子流浪记</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">1</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<!--<img src="../images/icons/new.png" class="i_pic" />-->
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">小王子流浪记</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">1</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<!--<img src="../images/icons/new.png" class="i_pic" />-->
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">小王子流浪记</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">1</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
					</div>
					<!--swiper slider the end-->
					<div class="swiper-slide" id="slider2">
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<img src="../images/icons/new.png" class="i_pic" />
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">雪国狼王</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">1</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
					</div>
					<div class="swiper-slide" id="slider3">
						<!--item begin-->
						<div class="item">
							<a href="bookdetail.html">
								<img src="../images/icons/new.png" class="i_pic" />
								<div class="item_left">
									<img src="#" class="bookpic" alt="这是图片"/>
								</div>
								<div class="item_right">
									<div class="item_right_top bookname">哈尔罗杰历险记</div>
									<div class="item_right_con agerangs">10~24岁</div>
									<div class="item_right_bot">
										<div class="isbn">
											<span>ISBN:</span><span>123457891234</span>
										</div>
										<div class="num">
											<span class="picleft type1">
												<span class="kc">库存</span>
												<span class="dic"></span>
											</span>
											<span class="count type1">
												<span class="kcs">5</span>
												<span class="mynum">1</span>
											</span>
											<span class="picright type1">
												<span class="add1"></span>
												<span class="add2"></span>
											</span>
										</div>
									</div>
								</div>
							</a>
						</div>
						<!--item the end-->
					</div>
					<!--swiper slider the end-->
				
				</div>
				<!--swiper wrapper the end-->
			</div>
			<!--swiper container the end-->
			
		</div>
		<!--footer开始-->
		<div class="footer">
			<a href="#" class="foot_left">
				<img src="../images/icons/save.png"  />
				<span>我的收藏</span>
			</a>
			<a href="#" class="foot_right">
				<div class="amount">
					0
				</div>
				<img src="../images/icons/buycar.png"  />
				<span>借购车</span>
			</a>
		</div>
		<!--footer结束-->
		<!--主体 结束-->
		<script type="text/javascript" src="../js/layui.all.js"></script>
		<script>
			window.onscroll=function(){console.log();
				var documentHeight=$(document).height();
				var windowHeight=$(window).height();
				var scrollHeight=$(document).scrollTop();
				if(documentHeight-scrollHeight==windowHeight){console.log("loading");
				$(".swiper-wrapper").css("height","auto");
				var slideLength=$(".Btnbutton").length;
				var id_now;var slidernow;
				 for(var i=0;i<slideLength;i++){
				 	if($(".Btnbutton").eq(i).hasClass("active")){
				 		
				 		id_now=i+1;
				 		break;
				 	}
				 	
				 }
				 slidernow="slider"+id_now;
					console.log(slidernow);
					layui.use('flow', function(){
					  var flow = layui.flow;
					  //信息流
					  flow.load({
					    elem: "#"+slidernow  //指定列表容器
					   
					    ,done: function(page, next){ //到达临界点（默认滚动触发），触发下一页
					       //模拟数据插入
					      setTimeout(function(){
					        var lis = [];
					        var html='<div class="item">'+
										'<a href="bookdetail.html">'+	
										'<img src="../images/icons/new.png" class="i_pic" />'+
										'<div class="item_left">'+
										'<img src="#" class="bookpic" alt="这是图片"/>'+
										'</div>'+
										'<div class="item_right">'+
										'<div class="item_right_top bookname">雪国狼王</div>'+
										'<div class="item_right_con agerangs">10~24岁</div>'+
										'<div class="item_right_bot">'+
										'<div class="isbn">'+
										'<span>ISBN:</span><span>123457891234</span>'	+
										'</div>'+
										'<div class="num">'+
										'<span class="picleft type1">'	+
										'<span class="kc">库存</span>'+		
										'<span class="dic"></span>'	+	
										'</span>'	+
										'<span class="count type1">'+	
										'<span class="kcs">5</span>'+		
										'<span class="mynum">1</span>'+		
										'</span>'	+
										'<span class="picright type1">'	+
										'<span class="add1"></span>'+		
										'<span class="add2"></span>'+		
										'</span>'	+
										'</div>'+
										'</div>'+
										'</div>'+
										'</a>'+
										'</div>';
					        for(var i = 0; i < 3; i++){
					          lis.push(html);
					        }
					        
					        //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
					        //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
					        next(lis.join(''), page < 5); //假设总页数为 10
					      }, 500);
					      
					     
					    }
					  });
			  
			 
			});
					
				}
			}
			
		</script>
	</body>
</html>
